/**
 * Created by IntelliJ IDEA.
 * User: yang
 * Date: 11-6-22
 * Time: 下午4:47
 * To change this template use File | Settings | File Templates.
 */
//清空商品的cookie
function clearProductsCookie(divId){
    var ck=document.cookie.split(";");
    var re=/.*?=/;
    var ne=[];
    for(var i=0; i<ck.length; i++){
        ne[i]=re.exec(ck[i])[0];
        var ckNm = ne[i];
        var index = ckNm.indexOf("ProductHistory", 0);
        if(index!=-1){
            document.cookie = ne[i]+";expires=Sat, 20 Jun 2009 23:17:11 UTC";
        }
    }
    $(divId).html("");
    return false;
}


//清空历史浏览商品的cookie  （推荐使用），参考万泽项目history.jsp
function jQueryClearProductsCookie(divId, productIds){
    var productIdArray = new Array();
    productIdArray = productIds.split(",");
    for (var i=0; i<productIdArray.length; i++) {
        jQuery.cookie("ProductHistory" + productIdArray[i], productIdArray[i], {expires : -30, path: '/'});
    }
    $(divId).html("");
    return false;
}




